From: Lionel Landwerlin Date: Wed, 19 Jun 2024 20:52:57 +0000 (+0300) Subject: [PATCH] clc: find opencl headers from the installed llvm/clang location X-Git-Tag: archive/raspbian/25.0.7-2+rpi1^2^2^2^2^2^2^2^2^2^2^2^2^2~2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=cf6fad0c8f52e92dde7630c3fc2c7e204854f840;p=mesa.git [PATCH] clc: find opencl headers from the installed llvm/clang location A number of people report the headers not being found when running intel-clc. I've run into the same issue but only on the most recent Ubuntu version. Signed-off-by: Lionel Landwerlin Gbp-Pq: Name clc-find-opencl-headers.diff --- diff --git a/src/compiler/clc/clc_helpers.cpp b/src/compiler/clc/clc_helpers.cpp index 346a81138..9cafc8810 100644 --- a/src/compiler/clc/clc_helpers.cpp +++ b/src/compiler/clc/clc_helpers.cpp @@ -906,6 +906,12 @@ clc_compile_to_llvm_module(LLVMContext &llvm_ctx, c->getHeaderSearchOpts().AddPath(clang_res_path.string(), clang::frontend::Angled, false, false); + + auto clang_install_res_path = + fs::path(LLVM_LIB_DIR) / "clang" / std::to_string(LLVM_VERSION_MAJOR) / "include"; + c->getHeaderSearchOpts().AddPath(clang_install_res_path.string(), + clang::frontend::Angled, + false, false); #endif // Enable/Disable optional OpenCL C features. Some can be toggled via `OpenCLExtensionsAsWritten`